package org.dizem.freepl0.compiler.reader;

import java.io.File;

/**
 * Created by IntelliJ IDEA.
 * User: DIZEM
 * Date: 11-2-1
 * Time: 下午10:23
 */
public class Reader {
	public String text;
	public int index = 0;

	public Reader(String text) {
		this.text = text;
	}

	public char nextChar() {
		if (index < text.length()) {
			return text.charAt(index++);
		} else
			return ' ';
	}

	public char next() {
		return text.charAt(index+1);
	}

	public void back() {
		index--;
	}

	public boolean isEnd() {
		return index >= text.length();
	}
}
